﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace ZGameFramework.Setting
{
    public interface ISettingMemory
    {
        /// <summary>
        /// 加载数据
        /// </summary>
        bool Load();

        /// <summary>
        /// 保存数据
        /// </summary>
        bool Save();

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <returns></returns>
        bool GetBool( string settingName );

        /// <summary>
        /// 获取数据
        /// 带缺省
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingDefault"></param>
        /// <returns></returns>
        bool GetBool(string settingName, bool settingDefault);

        /// <summary>
        /// 设置数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingValue"></param>
        void SetBool(string settingName, bool settingValue);

        /// <summary>
        /// 获取数据 Int
        /// </summary>
        /// <param name="settingName"></param>
        /// <returns></returns>
        int GetInt(string settingName);

        /// <summary>
        ///  获取数据 Int 
        ///  带默认值
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingDefault"></param>
        /// <returns></returns>
        int GetInt(string settingName, int settingDefault);

        /// <summary>
        /// 设置数据 Int
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingValue"></param>
        void SetInt(string settingName, int settingValue);

        /// <summary>
        /// 获取数据 
        /// </summary>
        /// <param name="settingName"></param>
        /// <returns></returns>
        float GetFloat(string settingName);

        /// <summary>
        /// 获取数据 
        /// 带缺省
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingDefault"></param>
        /// <returns></returns>
        float GetFloat(string settingName, float settingDefault);

        /// <summary>
        /// 设置参数
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingValue"></param>
        void SetFloat(string settingName, float settingValue);

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <returns></returns>
        string GetString(string settingName);

        /// <summary>
        /// 获取数据 
        /// 带缺省
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingDefault"></param>
        /// <returns></returns>
        string GetString(string settingName, string settingDefault);

        /// <summary>
        ///  设置数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingValue"></param>
        void SetString(string settingName, string settingValue);

        /// <summary>
        /// 获取数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <returns></returns>
        T GetObject<T>(string settingName);

        /// <summary>
        /// 获取数据
        /// 带缺省
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingDefault"></param>
        /// <returns></returns>
        T GetObject<T>(string settingName, T settingDefault);

        /// <summary>
        /// 设置数据
        /// </summary>
        /// <param name="settingName"></param>
        /// <param name="settingValue"></param>
        void SetObject<T>(string settingName, T settingValue);
    }

}
